fetcher: Send Accept-Encoding: gzip when downloading summary
authorAlexander Larsson <alexl@redhat.com>
Wed, 24 May 2017 09:12:05 +0000 (11:12 +0200)
committerAtomic Bot <atomic-devel@projectatomic.io>
Wed, 24 May 2017 13:52:17 +0000 (13:52 +0000)
commitbe0c02d4f99fc071b18c21856b61c340bb44d5ae
tree56d943191bf8e11ffe2257cf0720fafb5f8421e5
parent56188808b47cd93009816f6ee6e11f56c9356179
fetcher: Send Accept-Encoding: gzip when downloading summary

The summary file can get large, but it compresses well (something
which is not true of other files in the ostree repo which are
already compressed). By sending Accept-Encoding: gzip (and
handling the compressed results) we send a lot less data.

I set up the flathub repo (http://flathub.org/repo) to enable
gzip for the summary file (only), and the result is that the
331514 byte large summary was transferred in 122889 bytes.
On my (fast) network this decreased the time i took to do
"flatpak remote-ls flathub" by about 100msec.

This fixes https://github.com/ostreedev/ostree/issues/802

Closes: #882
Approved by: cgwalters
src/libostree/ostree-fetcher-curl.c
src/libostree/ostree-fetcher-soup.c
src/libostree/ostree-fetcher.h
src/libostree/ostree-repo-pull.c